<template>
  <el-dialog
    v-model="dialogVisible"
    title="条码规则查询"
    width="40%"
    @close="closeDialog"
  >
    <el-form class="aceauForm" label-width="120px" :model="form">
      <el-row :gutter="12">
        <el-col :span="12">
          <el-form-item label="规则编码">
            <el-input v-model="form.barcodeRuleCode" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="规则名称">
            <el-input v-model="form.barcodeRuleName" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="规则描述">
            <el-input v-model="form.barcodeRuleDescribe" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <template #footer>
      <span class="dialog-footer">
        <el-button type="primary" @click="query">查询</el-button>
        <el-button @click="dialogVisible = false">取消</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script setup>
  const dialogVisible = ref(false)
  const form = reactive({})

  const openDialog = () => {
    dialogVisible.value = true
  }

  const query = () => {
    _emits('query-callback', form)
    dialogVisible.value = false
  }

  const closeDialog = () => (dialogVisible.value = false)

  defineExpose({ openDialog })
  const _emits = defineEmits(['query-callback'])
</script>
